<div class="modal-header">
  <div class="modal-title">{{ action == 1 ? '添加' : '编辑' }}-用户</div>
</div>

<nz-spin nzTip="" [nzSpinning]="loading">
  <form nz-form #f="ngForm">
    <div class="user-desc mb-lg">
      <div class="user-desc__title">基本信息</div>
      <se-container col="2" labelWidth="90" class="user-desc__content">
        <!-- <se label="用户头像"> </se> -->
        <se required label="真实姓名">
          <input required nz-input placeholder="请输入真实姓名" [(ngModel)]="editForm.realname" name="realname" />
        </se>
        <se required label="性别">
          <nz-radio-group required [(ngModel)]="editForm.gender" name="gender">
            <label nz-radio nzValue="男">男</label>
            <label nz-radio nzValue="女">女</label>
          </nz-radio-group>
        </se>
        <se label="出生日期">
          <nz-date-picker
            class="select-birthdate"
            [nzDisabledDate]="disabledDate"
            [(ngModel)]="editForm.birthdate"
            name="birthdate"
          ></nz-date-picker>
        </se>
        <se required label="手机号码">
          <input required nz-input placeholder="请输入手机号码" [(ngModel)]="editForm.mobile" name="mobile" />
        </se>
        <se required label="邮箱">
          <input required nz-input placeholder="请输入邮箱" [(ngModel)]="editForm.email" name="email" />
        </se>
      </se-container>
    </div>
    <div class="user-desc mb-lg">
      <div class="user-desc__title">工作信息</div>
      <se-container col="2" labelWidth="90" class="user-desc__content">
        <se label="单位名称">
          <input nz-input placeholder="请输入单位名称" [(ngModel)]="editForm.companyName" name="companyName" />
        </se>
        <se label="所在省市">
          <nz-cascader
            nzPlaceHolder="请选择省市"
            [nzOptions]="cityList"
            [(ngModel)]="selectCity"
            name="province"
          ></nz-cascader>
        </se>
        <se label="职位">
          <nz-select nzPlaceHolder="请选择职位" [(ngModel)]="editForm.job" name="job">
            <nz-option *ngFor="let item of jobList" [nzLabel]="item.name" [nzValue]="item.name"></nz-option>
          </nz-select>
        </se>
        <se required label="工作时间">
          <nz-date-picker
            [required]="!editForm.isGraduate"
            [nzDisabled]="editForm.isGraduate"
            [nzDisabledDate]="disabledDate"
            [(ngModel)]="editForm.workTime"
            name="workTime"
          ></nz-date-picker>
          <label
            nz-checkbox
            [(ngModel)]="editForm.isGraduate"
            class="ml-md"
            name="isGraduate"
            (ngModelChange)="graduateChange($event)"
            >尚未毕业</label
          >
        </se>
        <se required label="专业领域" col="1">
          <nz-checkbox-wrapper (nzOnChange)="checkBoxChange($event)">
            <label
              *ngFor="let profession of professionList; let i = index"
              nz-checkbox
              [nzValue]="profession.value"
              [(ngModel)]="profession.checked"
              [name]="'profession' + i"
              >{{ profession.label }}</label
            >
          </nz-checkbox-wrapper>
        </se>
      </se-container>
    </div>
  </form>
</nz-spin>

<div class="modal-footer">
  <button nz-button nzType="default" (click)="close(false)">取消</button>
  <button nz-button nzType="primary" (click)="submit()" [disabled]="loading || f.invalid || !professionSelected.length">
    提交
  </button>
</div>
